/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.webanovare;

import java.util.Date;
import java.util.Random;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author expert
 */
@XmlRootElement(name = "news")
@XmlAccessorType(XmlAccessType.PROPERTY)
public class NewsProxy {
    private Long id;
    private Date date;
    private String newsText;
    
    public NewsProxy(Long id, Date date, String newsText) {
        this.id = id;
        this.date = date;
        this.newsText = newsText;
    }
    
    public NewsProxy(Date date, String newsText) {
        this.id = new Long(new Random().nextInt(100));
        this.date = date;
        this.newsText = newsText;
    }
    
    public NewsProxy() {}
    
    @XmlElement(name="id")
    public Long getId() {
        return this.id;
    }
    
    @XmlElement(name="date")
    public Date getDate() {
        return this.date;
    }
    
    @XmlElement(name="newsText")
    public String getNewsText() {
        return this.newsText;
    } 
}
